﻿@model LeadMaster.ViewModels.ViewModelCompanies

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    @Html.HiddenFor(m => m.Company.CompanyID)
    @Html.HiddenFor(m => m.Company.Category)
     <fieldset style="width: 850px">
        <legend>@Model.Company.Company</legend>
        <div class="leftcolumn">
            <div class="editor-label">
                @Html.LabelFor(model => model.Company.Company)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Company.Company, new { @class="largetextbox"})
                @Html.ValidationMessageFor(model => model.Company.Company)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Company.Address1)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.Address1)
                @Html.ValidationMessageFor(model => model.Company.Address1)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Company.Address2)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.Address2)
                @Html.ValidationMessageFor(model => model.Company.Address2)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Company.District)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.District)
                @Html.ValidationMessageFor(model => model.Company.District)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Company.Town)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.Town)
                @Html.ValidationMessageFor(model => model.Company.Town)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Company.County)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.County)
                @Html.ValidationMessageFor(model => model.Company.County)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Company.Postcode)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.Postcode)
                @Html.ValidationMessageFor(model => model.Company.Postcode)
            </div>

            </div>
            <div class="rightcolumn">

            <div class="editor-label">
                @Html.LabelFor(model => model.Company.HeadOffice)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.HeadOffice)
                @Html.ValidationMessageFor(model => model.Company.HeadOffice)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Company.Branch)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.Branch)
                @Html.ValidationMessageFor(model => model.Company.Branch)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Company.Alias)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.Alias)
                @Html.ValidationMessageFor(model => model.Company.Alias)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Company.CoNumber)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Company.CoNumber)
                @Html.ValidationMessageFor(model => model.Company.CoNumber)
            </div>
                        <div class="editor-label">
                @Html.LabelFor(model => model.Company.Telephone)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Company.Telephone, new { @class = "largetextbox" })
                @Html.RadioButtonFor(model => model.Company.DefaultTelephoneField, "Telephone")
                @Html.ValidationMessageFor(model => model.Company.Telephone)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Company.Tel2)
            </div>
            <div>
                @Html.TextBoxFor(model => model.Company.Tel2, new { @class = "largetextbox" })
                @Html.RadioButtonFor(model => model.Company.DefaultTelephoneField, "Tel2")
                @Html.ValidationMessageFor(model => model.Company.Tel2)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Company.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Company.Email, new { @class = "largetextbox" })
                @Html.ValidationMessageFor(model => model.Company.Email)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Company.WWW)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Company.WWW, new { @class = "largetextbox" })
                @Html.ValidationMessageFor(model => model.Company.WWW)
            </div>
        </div>
        <div style="margin-top: 10px; float: right; clear:both;">
            <input type="submit" value="Save" class="bigsubmit"/>
            <input type="button" value="Close" class="bigsubmit" id="companyeditcancel" />
        </div>

    </fieldset>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

<script type="text/javascript">
    $().ready(function () {

        $("#SectorID").val("@(Model.SectorID)");

        $("#companyeditcancel").click(function () {
            $("#companieseditdialog").dialog('close');
        });

    });
</script>

